﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Xml.Linq;

using System.Collections.Generic;

namespace Business
{
    public class DiaDiemDTO
    {
        private String m_TenDichVu = "";

        public String TenDichVu
        {
            get { return m_TenDichVu; }
            set { m_TenDichVu = value; }
        }

        private String m_TenDiaDiem = "";

        public String TenDiaDiem
        {
            get { return m_TenDiaDiem; }
            set { m_TenDiaDiem = value; }
        }

        private String m_DiaChi = "";

        public String DiaChi
        {
            get { return m_DiaChi; }
            set { m_DiaChi = value; }
        }

        private Double m_KinhDo = 0.0;

        public Double KinhDo
        {
            get { return m_KinhDo; }
            set { m_KinhDo = value; }
        }

        private Double m_ViDo = 0.0;

        public Double ViDo
        {
            get { return m_ViDo; }
            set { m_ViDo = value; }
        }

        private String m_ChuThich = "";

        public String ChuThich
        {
            get { return m_ChuThich; }
            set { m_ChuThich = value; }
        }

        static public List<DiaDiemDTO> TaoDanhSachDiaDiem(DataTable Table)
        {
            List<DiaDiemDTO> DanhSachDiaDiem = new List<DiaDiemDTO>();

            for (int index = 0; index < Table.Rows.Count; ++index)
            {
                DiaDiemDTO diadiem = DiaDiemDTO.TaoDiaDiem(Table.Rows[index]);

                DanhSachDiaDiem.Add(diadiem);
            }

            return DanhSachDiaDiem;
        }

        static public DiaDiemDTO TaoDiaDiem(DataRow row)
        {
            DiaDiemDTO diadiem = new DiaDiemDTO();

            diadiem.TenDiaDiem = row["TenDiaDiem"].ToString();
            diadiem.TenDichVu = row["TenDichVu"].ToString();

            diadiem.DiaChi = row["SoNha"].ToString() + "  " + row["TenDuong"].ToString() + " P." + row["TenPhuong"].ToString() + " Q.8 TP.HCM";
            diadiem.KinhDo = Convert.ToDouble(row["KinhDo"]);
            diadiem.ViDo = Convert.ToDouble(row["ViDo"]);
            diadiem.ChuThich = row["ChuThich"].ToString();

            return diadiem;
        }
    }
}
